<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/jsp/common/_includes.jsp" %>
<jsp:include page="/WEB-INF/jsp/common/_head.jsp"></jsp:include>
<link rel="stylesheet" href="/static/vendor/upload/css/jquery.fileupload.css" type="text/css" />
<div class="ui grid">
	<div class="row">
		<div class="column">
			<div class="ui two column grid">
				<div class="three wide column">
					<jsp:include page="/WEB-INF/jsp/common/_sidebar.jsp">
						<jsp:param name="index" value="11"/>
					</jsp:include>
				</div>
				<div id="container" class="thirteen wide column">
					<div class="alert alert-success w200 center-block text-center " style="display: none; " role="alert"></div>
					<ol class="breadcrumb">
						<li><a href="/">后台管理</a></li>
						<li class="active">编辑广告</li>
					</ol>
					<form:form cssClass="form-horizontal" id="addForm" modelAttribute="advertising" method="POST" action="/advertising/${advertising.id }/edit">
						<div class="form-group">
							<label class="col-sm-3 control-label">广告图片</label>
							<div class="col-sm-5">
								<img id="preview" width="300px" height="170px" src="${not empty advertising.advImg ? advertising.advImg : 'http://placehold.it/300x170'}">
							</div>
							<div class="col-sm-2">
								<span class="btn btn-success btn-block fileinput-button">
									<i class="glyphicon glyphicon-plus"></i>
									<span>上传图片</span>
									<input id="fileupload" type="file" name="attachFile" data-url="/img/upload" multiple>
								</span>
								<form:hidden path="advImg" id="js_advImg"></form:hidden>
								<i class="icon-ok-sign out"></i>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">链接地址</label>
							<div class="col-sm-5 desc">
								<form:input cssClass="form-control" path="link" placeholder="输入链接地址" />
								<i class="icon-ok-sign out"></i>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">展示位置</label>
							<div class="col-sm-5 desc">
								<form:select cssClass="form-control" path="positionCode">
									<option value="">请选择</option>
									<c:forEach items="${positionCodeList}" begin="1" var="positionCode">
										<form:option value="${positionCode.code}">${positionCode.text}</form:option>
									</c:forEach>
								</form:select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">房间</label>
							<div class="col-sm-5 desc">
								<form:hidden id="js_roomId" path="roomId" placeholder="请选择房间" />
								<form:input cssClass="form-control" autocomplete="off" id="js_roomName" path="roomName" placeholder="请选择房间" />
							</div>
						</div>
						<div class="form-group" id="js_submit">
							<div class="col-sm-offset-3 col-sm-2">
								<button type="submit" class="btn btn-success">提交</button>
							</div>
						</div>
					</form:form>
				</div>
			</div>
		</div>
	</div>
</div>

<jsp:include page="/WEB-INF/jsp/common/_foot.jsp"></jsp:include>
<script src="/static/vendor/jquery-ui/jquery-ui.min.js"></script>
<script src="/static/vendor/upload/js/vendor/jquery.ui.widget.js"></script>
<script src="/static/vendor/upload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="/static/vendor/jquery.validate/jquery.validate.js"></script>
<script type="text/javascript" src="/static/vendor/jquery.validate/jquery.validate.messages_cn.js"></script>
<script src="/static/vendor/upload/js/jquery.fileupload.js"></script>
<script type="text/javascript" src="/static/js/advertising/add.js"></script>